package com.victor.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 投票用户表
 * 
 * @author Mr.Zhang
 *
 */
@Entity
@Table(name = "user")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) // 主键类型--自动递增生成
	@Column(name = "id", unique = true, nullable = false, length = 11)
	private Integer id;// 主键id

	@Column(name = "openid", length = 50)
	private String openid;// 微信openid

	@Column(name = "identity", length = 50)
	private String identity;// 投票人身份(1.家长学生, 2.幼儿教师, 3.小学教师)

	@Column(name = "school", length = 50)
	private String school;// 投票人学校

	@Column(name = "agegroup", length = 2)
	private String agegroup;// 年龄段(
							// 1.2-3,
							// 2.4-5,
							// 3.6-7,
							// 4.8-9,
							// 5.10-11,
							// 6.12以上,
//						暂不用
							// 7.大班,
							// 8.小班,
							// 9.低年级,
							// 10.中年级,
							// 11.高年级
							// )
	@Column(name = "voteaddress", length = 50)
	private String voteaddress;	// 城市
	
	@Transient
	private String ip;

	@Transient
	private List<Vote> votes;

}
